package acm.europe2001.central;

import java.util.Scanner;

/*
 * p1477
 * ACM Central European 2001
 */

public class p1477 {

	static int d, n, pos;

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		d = scanner.nextInt();
		for (int i=1;i<=d;++i) {
			n = scanner.nextInt();
			pos = 0;
			while (n > 0) {
				if (n % 2 == 1) {
					System.out.print(pos);
					if (n/2 == 0) {
						System.out.println();
					}
					else {
						System.out.print(" ");
					}
				}
				n /= 2;
				pos++;
			}
		}

	}

}
